package edu.towson.cosc603.coffeemaker;


import static org.junit.Assert.*;
import junit.framework.TestCase;

import org.junit.Before;
import org.junit.Test;

public class InventoryTest extends TestCase {
	private Inventory inventory;
	private Recipe recipe;
	
	@Before
	public void setUp() throws Exception {
		inventory = new Inventory();
		recipe = new Recipe();
		recipe.setAmtCoffee(100);
		recipe.setAmtMilk(100);
		recipe.setAmtSugar(100);
		recipe.setAmtChocolate(100);
	}
	
	@Test
	public void testGetChocolate () {
		assertEquals(15, inventory.getChocolate());
	}
	
	@Test
	public void testGetCoffee () {
		assertEquals(15, inventory.getCoffee());
	}
	
	@Test
	public void testGetMilk () {
		assertEquals(15, inventory.getMilk());
	}
	
	@Test
	public void testGetSugar () {
		assertEquals(15, inventory.getSugar());
	}
	
	
	@Test
	public void testSetChocolate () {
		inventory.setChocolate(-1);
		assertEquals(0, inventory.getChocolate());
	}
	
	@Test
	public void testSetCoffee () {
		inventory.setCoffee(-1);
		assertEquals(0, inventory.getCoffee());
	}
	
	@Test
	public void testSetMilk () {
		inventory.setMilk(-1);
		assertEquals(0, inventory.getMilk());
	}
	
	@Test
	public void testSetSugar () {
		inventory.setSugar(-1);
		assertEquals(0, inventory.getSugar());
	}
	
	@Test
	public void testEnoughIngredients () {
		assertFalse(inventory.enoughIngredients(recipe));
	}
	
	@Test
	public void testTrueEnoughIngredients () {
		inventory.setChocolate(1000);
		inventory.setCoffee(1000);
		inventory.setMilk(1000);
		inventory.setSugar(1000);
		assertTrue(inventory.enoughIngredients(recipe));
	}

}
